home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 355 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: clamage@Eng.Sun.COM (Steve Clamage)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Anyone considered inheritable friendship?
  5. Date: 12 Feb 1996 10:24:02 PST
  6. Organization: Sun Microsystems Inc.
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4fnrfr$7b1@engnews1.Eng.Sun.COM>
  9. References: <AFVop7nqs7@qsar.chem.msu.su>
  10. Reply-To: clamage@Eng.Sun.COM
  11. NNTP-Posting-Host: isolde.mti.sgi.com
  12. X-Original-Date: 12 Feb 1996 16:56:27 GMT
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMR+F0Ey4NqrwXLNJAQGqkgIAvcNoGPIkY/8JokWK7zbcJsmq8+wAt+EU
  15.     zB/6cC+8XW+wL5sDL+Q9yDJUllupZnqnslsw+OnAT5b4oTq9e5OkRw==
  16.     =LI4R
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. In article AFVop7nqs7@qsar.chem.msu.su, "Eugene Radchenko" <eugene@qsar.chem.msu.su> writes:
  20.  
  21. >Has anyone proposed/considered the inheritable friendship in addition to
  22. >the current one? Suppose the following design (non-template version for
  23. >brevity): ...
  24.  
  25. >I think we should allow inheritable friendship (probably in addition to
  26. >current non-inheritable one). Anyway, we are not creating the Pentagon
  27. >security system and thus should not be much afraid of deriving Spy from
  28. >TrustedUser. Especially considering that otherwise all ends in making this
  29. >data public.
  30.  
  31. I don't see much difference between allowing friendship to be inherited
  32. and making all class members public. The purpose of access control is
  33. not to hide implementation details from other programmers, because it
  34. does not do that. The purpose is more to prevent other parts of the
  35. program from depending on implementations details as opposed to depending
  36. only on the public interface.
  37.  
  38. If friendship is inheritable, you cannot know what functions have access to
  39. the implementation details of the class. That means that you cannot change
  40. those details. You might as well make everything public. The effect on
  41. program design and maintenance is comparable.
  42.  
  43. ---
  44. Steve Clamage, stephen.clamage@eng.sun.com
  45. ---
  46. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  47.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  48.   in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
  49.